// ？条件运算符

class Person {
  String name = 'zs';
  int age = 18;
  Person(this.name, this.age);
  void printInfo() {
    print('$name-----$age');
  }
}

class P extends  Person {
  String like = '打球';
  P(super.name, super.age, like){
    this.like = like;
  }

  @override  // 如果需要复写父类方法，同名即可
  printInfo() {
    print('ssssss');
  }
  printLike() {
    super.printInfo();
    print(super.name);
    print('爱好: ${this.like}');
  }

}

void main() {
  P p = new P('李四', 17, '踢足球');
  p.printInfo();
  p.printLike();
}